/**  
* @Title: UserService.java 
* @Description:
* @Copyright: Copyright (c) 2018
* @Company:http://www.sinocon.cn
* @author Administrator  
* @date 2018年3月27日  
* @version 1.0  
*/  
package com.yuanlinsu.project.system.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuanlinsu.project.system.user.dao.IUserDao;
import com.yuanlinsu.project.system.user.entity.User;

/**  
* @Title: UserService 
* @Description:
* @author:Administrator  
* @date 2018年3月27日  
*/
@Service("userService")
public class UserService implements IUserService {

	private @Autowired IUserDao userDao;

	/*
	 * (non-Javadoc)
	 * 
	 * <p>Title: selectUserByName</p>
	 * 
	 * <p>Description: </p>
	 * 
	 * @param userName
	 * 
	 * @return
	 * 
	 * @see
	 * com.yuanlinsu.project.system.user.service.IUserService#selectUserByName(
	 * java.lang.String)
	 * 
	 */
	@Override
	public User selectUserByName(String userName) {
		return this.userDao.selectOne(new User(userName));
	}

	/*
	 * (non-Javadoc)
	 * 
	 * <p>Title: selectUserById</p>
	 * 
	 * <p>Description: </p>
	 * 
	 * @param userId
	 * 
	 * @return
	 * 
	 * @see
	 * com.yuanlinsu.project.system.user.service.IUserService#selectUserById(
	 * java.lang.Long)
	 * 
	 */
	@Override
	public User selectUserById(Long userId) {
		User u = new User(userId);
		return this.userDao.selectOne(u);
	}

	/**
	 * @return the userDao
	 */
	public IUserDao getUserDao() {
		return userDao;
	}

	/**
	 * @param userDao the userDao to set
	 */
	public void setUserDao(IUserDao userDao) {
		this.userDao = userDao;
	}

}
